package com.smart;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.widget.TabHost;

public class ContactTab extends TabActivity {
	public static final String TAG = "ContactTab" ;
	private static final String DIAPAD = "diapad" ;
	private static final String CONTACTLIST = "contactlist" ;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE) ;
		setContentView(R.layout.contact_tab);
		init() ;
		startService(new Intent("com.smart.HoldService")) ;
	}
	private void init(){
		TabHost tabHost = this.getTabHost() ;
		tabHost.addTab(tabHost.newTabSpec(DIAPAD).setIndicator(getString(R.string.dialerIconLabel),getResources().getDrawable(R.drawable.ic_tab_dialer))
				.setContent(new Intent(this,SmartDialeActivity.class))) ;
		
		tabHost.addTab(tabHost.newTabSpec(CONTACTLIST).setIndicator(getString(R.string.contactsIconLabel),getResources().getDrawable(R.drawable.ic_tab_contacts))
				.setContent(new Intent(this,ContactSearchActivity.class))) ;
		tabHost.setCurrentTabByTag(DIAPAD) ;
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		Log.v(TAG, "width of tabWidget = " +getTabWidget().getWidth() +" ,height of tabHost is = "+ getTabWidget().getHeight()) ;
	}

	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
	}
	
}
